from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

wb = webdriver.Edge()
wb.get('https://www.bilibili.com/')

wb.maximize_window()

wb.find_element(by=By.CLASS_NAME, value='header-login-entry').click()

time.sleep(1)

wb.find_element(by=By.XPATH, value='//div/input[@placeholder="请输入账号"]').send_keys('这里输入自己的账号')

wb.find_element(by=By.XPATH, value='//div/input[@placeholder="请输入密码"]').send_keys('这里输入自己的密码')
wb.find_element(by=By.CLASS_NAME, value="btn_primary").click()
# locator = (By.CLASS_NAME, "geetest_widget")
WebDriverWait(driver=wb, timeout=60, poll_frequency=0.3).until(EC.presence_of_element_located((By.XPATH, '//li[@class="v-popover-wrap"]/a[@class="right-entry__outside"]')), message="Element Not Found")
wb.find_element(By.XPATH, value='//ul[@class="right-entry"]/li[5]').click()

time.sleep(2)


